#include <stdio.h>
#include <stdlib.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define ABS(a) (((a) > 0) ? (a) : -(a))

typedef struct {
    int left;
    int top;
    int right;
    int bottom;
} rect;

typedef struct {
    int x;
    int y;
} relation;

int read_rect(rect* in) {
    int x1, y1, x2, y2;
    if (scanf("%d%d%d%d", &x1, &y1, &x2, &y2) != 4) {
        return 0;
    }
    in -> left = MIN(x1, x2);
    in -> top = MIN(y1, y2);
    in -> right = MAX(x1, x2);
    in -> bottom = MAX(y1, y2);
    return 1;
}

int rect_size(rect obj) {
    return (obj.right - obj.left) * (obj.bottom - obj.top);
}

relation rect_relation(rect* a, rect* b) {
    relation res = {0, 0};
    if (a -> right < b -> left) {
        res.x = -1;
    } else if (a -> left > b -> right) {
        res.x = 1;
    }
    if (a -> bottom < b -> top) {
        res.y = -1;
    } else if (a -> top > b -> bottom) {
        res.x = 1;
    }
    return res;
}

int compar(const void *p1, const void *p2) {
    return *((int*) p1) > *((int*) p2);
}

int main() {
    rect a, b;
    while(read_rect(&a) && read_rect(&b)) {
        relation rel = rect_relation(&a, &b);
        int size_a = rect_size(a);
        int size_b = rect_size(b);
        int size_common = 0;
        if (rel.x == 0 && rel.y == 0) {
            int array_x[4] = {a.left, a.right, b.left, b.right};
            int array_y[4] = {a.top, a.bottom, b.top, b.bottom};
            qsort(array_x, 4, sizeof(int), compar);
            qsort(array_y, 4, sizeof(int), compar);
            int diff_x = array_x[2] - array_x[1];
            int diff_y = array_y[2] - array_y[1];
            size_common = diff_x * diff_y;
        }
        printf("%d\n", size_a + size_b - size_common);
    }
    return 0;
}
